package 集合.day1.demo1;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

public class Test2 {
    public static void main(String[] args) {
        List list=new ArrayList();
        Vector v;
        list.add("111");
        list.add("222");
        System.out.println("------iterator---------");
        Iterator it=list.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }
        System.out.println("-----------for each--------");
        for(Object o:list){
            System.out.println(o);
        }
    }
}
